package com.github.ki4so.sso.dto;

public enum LoginType {

	SMS_QUICK_LOGIN(0, "短信快捷登录"),

	MAIL_QUICK_LOGIN(1, "邮箱快捷登录"),

	PASSWORD_LOGIN(2, "普通密码登录");

	public int code;

	private String msg;

	public int getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	private LoginType(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public static LoginType valueOfByCode(int code) {
		if (code < 0) {
			return null;
		}
		for(LoginType loginType: values()) {
			if (code == loginType.getCode()) {
				return loginType;
			}
		}
		return null;
	}

}